package thread;

public class Demo31 {
    public static int total;

    public static void main(String[] args) throws InterruptedException {
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 10000; i++) {
                    total++;
                }
            }
        };
        Thread t1 = new Thread(runnable);
        t1.start();
        t1.join();
        System.out.println(total);
    }
}
